import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
import { type PaginationProps } from "@pureadmin/table";

type resultAPI = {
  isSuccess?: boolean;
  success?: boolean;
  msg?: string;
  pageInfo?: object;
  result?: Array<any>;
  onePage?: PaginationProps;
  data?: any;
};
//================下面是对AI配置进行设置  作者：李成 2024年7月23日===========================
//获取系统中所有的机构信息
export const getSysCompanyList = (data?: object) => {
  return http.request<resultAPI>(
    "post",
    baseUrlApi("System/getSysCompanyList"),
    {
      data
    }
  );
};

//通过ID获取单个机构信息
export const getSysCompany = (data?: object) => {
  return http.request<resultAPI>("post", baseUrlApi("System/getSysCompany"), {
    data
  });
};

//保存一个机构信息
export const saveSysCompany = (data?: object) => {
  return http.request<resultAPI>("post", baseUrlApi("System/saveSysCompany"), {
    data
  });
};

//删除一个机构信息
export const delSysCompany = (params?: object) => {
  return http.request<resultAPI>("post", baseUrlApi("System/delSysCompany"), {
    params
  });
};
